package com.wanxi.user.api;

import com.wanxi.user.domain.dto.UserInfoDto;
import com.wanxi.user.domain.entity.UserInfo;
import com.wanxi.user.domain.query.UserQuery;
import com.wanxi.user.domain.result.UserResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author:Iny
 * @Data：2021/12/31 10:47
 */
@FeignClient(value = "user",path = "/back/user")
public interface UserFeign {
    @PostMapping("/addUser")
    UserResult<Integer> addUser(@RequestBody UserInfoDto userInfoDto);

    @ApiOperation(value="后台查询用户信息")
    @GetMapping("findAll")
    UserResult<List<UserInfo>> findAll(@RequestBody UserQuery userQuery);

    @ApiOperation(value="通过id查找用户信息")
    @GetMapping("findById")
    UserResult<UserInfo> findById(@RequestParam("userId") long userId);

    @ApiOperation(value = "通过id修改用户信息")
    @PutMapping("updateById")
    UserResult<Boolean> updateById(@RequestBody UserInfoDto userInfoDto);

}
